package com.molyfun.parents.rest.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.molyfun.parents.activity.report.iepPlan.IProductDetailTabCell;
import com.molyfun.parents.rest.BaseResponse;

import java.util.List;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:03/02/16.
 */
public class ProductDetailResponse extends BaseResponse {

    private ProductDetailBean data;

    public ProductDetailBean getData(){
        return data;
    }

    public static class ProductDetailBean implements Parcelable {


        /**
         * id : 4028b8815a8d9fca015a8da346360002
         * name : 套餐B
         * introduce : 哈哈哦哦嗷嗷
         * expdate : 50
         * price : 100
         * discountprice : 0.01
         * url : http://oa91iwip0.bkt.clouddn.com/helloimg/product/20170302/20170302140924pAE8QIa3.jpg?imageMogr2/thumbnail/300x300
         * createdatetime : 1488434972000
         * delflag:// //1  下架 0 上架
         * remarks : s'd'f's'd'f
         * productitemlist : [{"id":"4028b8815a8d9fca015a8da62253000d","name":"服务项3","availabletime":"2个月","times":6,"createdatetime":1488435160000,"imglist":[{"url":"http://oa91iwip0.bkt.clouddn.com/helloimg/1/20170302/20170302141249LcrdxCOx.jpg","type":"1","cover":null}],"servicerlist":[{"id":"4028b8815a8d9fca015a8da622a3000e","userid":"8a2d9263599105e9015995850c1506bb","userName":"张老师"},{"id":"4028b8815a8d9fca015a8da622ac000f","userid":"8a2d926358dcc24d01591abd3500644a","userName":"李老师"}]}]
         * imglist : [{"url":"http://oa91iwip0.bkt.clouddn.com/helloimg/1/20170302/20170302141325yBBrRHk6.jpg","type":"1","cover":null}]
         * typeid : 4028b8815a845280015a845460b00001
         * applicablescope : 9到20
         * attention :  士大夫十分
         * feature : 胜多负少
         */

        private String id;
        private String name;
        private String introduce;
        private int expdate;
        private double price;
        private double discountprice;
        private String url;
        private long createdatetime;
        private String delflag;
        private String remarks;
        private String typeid;
        private String applicablescope;
        private String attention;
        private String feature;
        private List<ProductitemlistBean> productitemlist;
        private List<MediaobjectlistBean> imglist;
        //出售数
        private int sellcount;
        //库存
        private int stock;

        public String getDelflag() {
            return delflag;
        }

        public void setDelflag(String delflag) {
            this.delflag = delflag;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getIntroduce() {
            return introduce;
        }

        public void setIntroduce(String introduce) {
            this.introduce = introduce;
        }

        public int getExpdate() {
            return expdate;
        }

        public void setExpdate(int expdate) {
            this.expdate = expdate;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public double getDiscountprice() {
            return discountprice;
        }

        public void setDiscountprice(double discountprice) {
            this.discountprice = discountprice;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public long getCreatedatetime() {
            return createdatetime;
        }

        public void setCreatedatetime(long createdatetime) {
            this.createdatetime = createdatetime;
        }

        public String getRemarks() {
            return remarks;
        }

        public void setRemarks(String remarks) {
            this.remarks = remarks;
        }

        public String getTypeid() {
            return typeid;
        }

        public void setTypeid(String typeid) {
            this.typeid = typeid;
        }

        public String getApplicablescope() {
            return applicablescope;
        }

        public void setApplicablescope(String applicablescope) {
            this.applicablescope = applicablescope;
        }

        public String getAttention() {
            return attention;
        }

        public void setAttention(String attention) {
            this.attention = attention;
        }

        public String getFeature() {
            return feature;
        }

        public void setFeature(String feature) {
            this.feature = feature;
        }

        public List<ProductitemlistBean> getProductitemlist() {
            return productitemlist;
        }

        public void setProductitemlist(List<ProductitemlistBean> productitemlist) {
            this.productitemlist = productitemlist;
        }

        public int getSellcount() {
            return sellcount;
        }

        public void setSellcount(int sellcount) {
            this.sellcount = sellcount;
        }

        public int getStock() {
            return stock;
        }

        public void setStock(int stock) {
            this.stock = stock;
        }

        public List<MediaobjectlistBean> getImglist() {
            return imglist;
        }

        public void setImglist(List<MediaobjectlistBean> imglist) {
            this.imglist = imglist;
        }


        public ProductDetailBean() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.name);
            dest.writeString(this.introduce);
            dest.writeInt(this.expdate);
            dest.writeDouble(this.price);
            dest.writeDouble(this.discountprice);
            dest.writeString(this.url);
            dest.writeLong(this.createdatetime);
            dest.writeString(this.delflag);
            dest.writeString(this.remarks);
            dest.writeString(this.typeid);
            dest.writeString(this.applicablescope);
            dest.writeString(this.attention);
            dest.writeString(this.feature);
            dest.writeTypedList(this.productitemlist);
            dest.writeTypedList(this.imglist);
            dest.writeInt(this.sellcount);
            dest.writeInt(this.stock);
        }

        protected ProductDetailBean(Parcel in) {
            this.id = in.readString();
            this.name = in.readString();
            this.introduce = in.readString();
            this.expdate = in.readInt();
            this.price = in.readDouble();
            this.discountprice = in.readDouble();
            this.url = in.readString();
            this.createdatetime = in.readLong();
            this.delflag = in.readString();
            this.remarks = in.readString();
            this.typeid = in.readString();
            this.applicablescope = in.readString();
            this.attention = in.readString();
            this.feature = in.readString();
            this.productitemlist = in.createTypedArrayList(ProductitemlistBean.CREATOR);
            this.imglist = in.createTypedArrayList(MediaobjectlistBean.CREATOR);
            this.sellcount = in.readInt();
            this.stock = in.readInt();
        }

        public static final Creator<ProductDetailBean> CREATOR = new Creator<ProductDetailBean>() {
            @Override
            public ProductDetailBean createFromParcel(Parcel source) {
                return new ProductDetailBean(source);
            }

            @Override
            public ProductDetailBean[] newArray(int size) {
                return new ProductDetailBean[size];
            }
        };
    }

    public static class ProductitemlistBean implements IProductDetailTabCell, Parcelable

    {
        /**
         * id : 4028b8815a8d9fca015a8da62253000d
         * name : 服务项3
         * availabletime : 2个月
         * times : 6
         * createdatetime : 1488435160000
         * imglist : [{"url":"http://oa91iwip0.bkt.clouddn.com/helloimg/1/20170302/20170302141249LcrdxCOx.jpg","type":"1","cover":null}]
         * servicerlist : [{"id":"4028b8815a8d9fca015a8da622a3000e","userid":"8a2d9263599105e9015995850c1506bb","userName":"张老师"},{"id":"4028b8815a8d9fca015a8da622ac000f","userid":"8a2d926358dcc24d01591abd3500644a","userName":"李老师"}]
         */

        private String id;
        private String name;
        private String availabletime;
        private int times;
        private String appointment;//是否需要预约
        private long createdatetime;
        private List<MediaobjectlistBean> imglist;
        private List<ServicerlistBean> servicerlist;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAvailabletime() {
            return availabletime;
        }

        public void setAvailabletime(String availabletime) {
            this.availabletime = availabletime;
        }

        public int getTimes() {
            return times;
        }

        public void setTimes(int times) {
            this.times = times;
        }

        public long getCreatedatetime() {
            return createdatetime;
        }

        public void setCreatedatetime(long createdatetime) {
            this.createdatetime = createdatetime;
        }

        public List<MediaobjectlistBean> getImglist() {
            return imglist;
        }

        public void setImglist(List<MediaobjectlistBean> imglist) {
            this.imglist = imglist;
        }

        public List<ServicerlistBean> getServicerlist() {
            return servicerlist;
        }

        public void setServicerlist(List<ServicerlistBean> servicerlist) {
            this.servicerlist = servicerlist;
        }

        public String getAppointment() {
            return appointment;
        }

        public void setAppointment(String appointment) {
            this.appointment = appointment;
        }


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.name);
            dest.writeString(this.availabletime);
            dest.writeInt(this.times);
            dest.writeString(this.appointment);
            dest.writeLong(this.createdatetime);
            dest.writeTypedList(this.imglist);
            dest.writeTypedList(this.servicerlist);
        }

        public ProductitemlistBean() {
        }

        protected ProductitemlistBean(Parcel in) {
            this.id = in.readString();
            this.name = in.readString();
            this.availabletime = in.readString();
            this.times = in.readInt();
            this.appointment = in.readString();
            this.createdatetime = in.readLong();
            this.imglist = in.createTypedArrayList(MediaobjectlistBean.CREATOR);
            this.servicerlist = in.createTypedArrayList(ServicerlistBean.CREATOR);
        }

        public static final Parcelable.Creator<ProductitemlistBean> CREATOR = new Parcelable.Creator<ProductitemlistBean>() {
            @Override
            public ProductitemlistBean createFromParcel(Parcel source) {
                return new ProductitemlistBean(source);
            }

            @Override
            public ProductitemlistBean[] newArray(int size) {
                return new ProductitemlistBean[size];
            }
        };
    }

    public static class ServicerlistBean implements Parcelable {
        /**
         * id : 4028b8815a8d9fca015a8da622a3000e
         * userid : 8a2d9263599105e9015995850c1506bb
         * userName : 张老师
         */

        private String id;
        private String userid;
        private String userName;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getUserid() {
            return userid;
        }

        public void setUserid(String userid) {
            this.userid = userid;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.userid);
            dest.writeString(this.userName);
        }

        public ServicerlistBean() {
        }

        protected ServicerlistBean(Parcel in) {
            this.id = in.readString();
            this.userid = in.readString();
            this.userName = in.readString();
        }

        public static final Parcelable.Creator<ServicerlistBean> CREATOR = new Parcelable.Creator<ServicerlistBean>() {
            @Override
            public ServicerlistBean createFromParcel(Parcel source) {
                return new ServicerlistBean(source);
            }

            @Override
            public ServicerlistBean[] newArray(int size) {
                return new ServicerlistBean[size];
            }
        };
    }

}
